<?php
namespace app\zmt\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule=[
        'user_name' => 'require|max:20',
        'mobile' => 'require|mobile|unique:user',
        'password' => 'require|min:6',
    ];
    protected $message=[
        'user_name.require'=>'请输入名字',
        'mobile.require'=>'请输入手机号',
        'mobile.max'=>'手机号最大11位',
        'mobile.min'=>'手机号格式不对',
        'password.require'=>'请输入密码',
        'password.min'=>'密码最少6位',
    ];
    protected $scene = [
        'registration' => ['user_name', 'mobile','password'],
        'edit' => ['user_name', 'mobile','password'],
    ];
}